package com.pdg.mcplugin.invisiblehand;

import org.bukkit.command.CommandSender;

import com.pdg.mcplugin.common.deprecated.DeprecatedPermissionCheckerBase;

public class PermissionChecker extends DeprecatedPermissionCheckerBase<InvisibleHand> {

	private static final String PERMISSION_ADMIN = "invisiblehand.admin";
	private static final String PERMISSION_BUY = "invisiblehand.buy";
	private static final String PERMISSION_CONFIG = "invisiblehand.config";
	private static final String PERMISSION_CREATE = "invisiblehand.create";
	private static final String PERMISSION_GET = "invisiblehand.get";
	private static final String PERMISSION_PRICE = "invisiblehand.price";
	private static final String PERMISSION_PRICES = "invisiblehand.prices";
	private static final String PERMISSION_REMOVE = "invisiblehand.remove";
	private static final String PERMISSION_SELL = "invisiblehand.sell";

	public PermissionChecker(InvisibleHand thePlugin) {
		super(thePlugin);
	}
	
	public boolean hasAdminPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_ADMIN,true);
	}
	
	public boolean hasBuyPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_BUY,false);
	}
	
	public boolean hasConfigPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_CONFIG,true);
	}
	
	public boolean hasCreatePermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_CREATE,true);
	}
	
	public boolean hasGetPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_GET,true);
	}
	
	public boolean hasPricePermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_PRICE,true);
	}
	
	public boolean hasPricesPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_PRICES,true);
	}
	
	public boolean hasRemovePermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_REMOVE,true);
	}
	
	public boolean hasSellPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_SELL,false);
	}

	@Override
	protected boolean shouldSuppressNoPermissionMessages(
			String thePermissionName) {
		return false;
	}

}
